<?php

namespace Home\Model;
use Think\Model;

class ServiceApisModel extends Model {
	
	//获取单条api记录
	public function getInfo($api_id){
		if(empty($api_id)) return null;

		$info = $this->where('api_id='.(int) $api_id)->find();
		return $info;
	}

	//
	public function getInfoWithAuth($api_id,$uid){
		if(empty($api_id) || empty($uid)) return null;


	}

	//
	public function getServiceWithApi(){

	}

	//某服务商用户，已审核，发布（需要最新服务名称）
	public function getAllApiInfos($uid){
		if(empty($uid)) return array();
		$sql = "select api.*,s.service_name s_service_name from dmp_service_apis api left join dmp_services s on s.service_id=api.service_id where api.api_auth_status=2 and api.api_status=1 and api.uid = ".$uid;
		$result = $this->query($sql);

		return $result;

	}

}

?>